import { Controller, Get, Post, Body, Patch, Param, Delete, Query, Request } from '@nestjs/common';
import { ApiOperation, ApiTags, ApiQuery, ApiBearerAuth } from '@nestjs/swagger';
import { GateService } from './gate.service';
import { Public } from '../auth/decorators/public.decorator';

@ApiTags('gate的公共接口')
@Public()
@Controller('gate')
export class GateController {
  constructor(private readonly gateService: GateService) {}

  // 合约详情
  @Get('contract')
  @ApiOperation({ summary: '查询', description: '查询' })
  @ApiQuery({ name: 'contract', required: false, description: 'contract' })
  findAll(@Query() params: any) {
    return this.gateService.contract(params);
  }

  @Get('tickers')
  @ApiOperation({ summary: '合约交易行情', description: '合约交易行情' })
  tickers(@Query() params: any) {
    return this.gateService.tickers(params);
  }

  @Get('kline')
  @ApiOperation({ summary: 'k线图', description: 'k线图' })
  kline(@Query() params: any) {
    return this.gateService.kline(params);
  }

  @Get('orderBook')
  @ApiOperation({ summary: '市场深度信息', description: '市场深度信息' })
  orderBook(@Query() params: any) {
    return this.gateService.orderBook(params);
  }

  @Get('feiLv')
  @ApiOperation({ summary: '个人交易费率', description: '个人交易费率' })
  feiLv(@Query() params: any) {
    return this.gateService.feiLv(params);
  }
}
